﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;

namespace YK.Framework.Security
{
    /// <summary>
    /// 用户
    /// </summary>
    [Serializable]
    public class User : EntityBase
    { 
        /// <summary>
        /// 登录名
        /// </summary>
        public string Username { get; set; }
        
        /// <summary>
        /// 电子邮件地址
        /// </summary>
        public string Email { get; set; }        

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }     

        /// <summary>
        /// 密码格式
        /// </summary>
        public System.Web.Security.MembershipPasswordFormat PasswordFormat { get; set; }
        
        /// <summary>
        /// 辅助密码验证
        /// </summary>
        public string PasswordSalt { get; set; }       

        /// <summary>
        /// 密码提示问题
        /// </summary>
        public string PasswordQuestion { get; set; }       

        /// <summary>
        /// 密码提示答案
        /// </summary>
        public string PasswordAnswer { get; set; }       

        /// <summary>
        /// 是否是匿名用户
        /// </summary>
        public bool IsAnonymous { get; set; }      

        /// <summary>
        /// 是否可以进行身份验证
        /// </summary>
        public bool IsApproved { get; set; }       

        /// <summary>
        /// 是否因被锁定而无法进行验证
        /// </summary>
        public bool IsLockedOut { get; set; }       

        /// <summary>
        /// 创建日期和时间
        /// </summary>
        public DateTime CreateDate { get; set; }        

        /// <summary>
        /// 最后一次进行身份验证或访问应用程序的日期和时间
        /// </summary>
        public DateTime LastActivityDate { get; set; }      

        /// <summary>
        /// 最后一次进行身份验证的日期和时间
        /// </summary>
        public DateTime LastLoginDate { get; set; }        

        /// <summary>
        /// 最后一次更新密码的日期和时间
        /// </summary>
        public DateTime LastPasswordChangedDate { get; set; }
       
        /// <summary>
        /// 最后一次锁定的日期和时间
        /// </summary>
        public DateTime LastLockoutDate { get; set; }
      
        /// <summary>
        /// 密码重试次数
        /// </summary>
        public int FailedPasswordAttemptCount { get; set; }
      
        /// <summary>
        /// 密码失败尝试窗口打开的日期和时间
        /// </summary>
        public DateTime FailedPasswordAttemptWindowStart { get; set; }       

        /// <summary>
        /// 密码提示答案重试次数
        /// </summary>
        public int FailedPasswordAnswerAttemptCount { get; set; }
      
        /// <summary>
        /// 密码提示答案失败尝试窗口打开的日期和时间
        /// </summary>
        public DateTime FailedPasswordAnswerAttemptWindowStart { get; set; }
        
        /// <summary>
        /// 其它自定义信息
        /// </summary>
        public string Comment { get; set; }        

        /// <summary>
        /// 应用程序
        /// </summary>
        public Application Application { get; set; }
       
        /// <summary>
        /// 
        /// </summary>
        public IEnumerable<Role> Roles { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public User()
        {
            Roles = new List<Role>();
        }
       
    }
}